package com.midcode;

import com.parser.program;

public class Var {
	public static int varPtr=0;
	public static int stackPtr=0;
	public static Var var;
	public static Var get_instance(){
		if(var == null){
			var = new Var();
		}
		return var;
	}
	public void newVar(){
		program.var= new String("var"+varPtr);
		System.out.println(varPtr);
		varPtr++;
	}
	public void push(String var){
		program.varStack.add(var);
		stackPtr++;
	}
	public String pop(){
		String a=program.varStack.get(--stackPtr);
		program.varStack.remove(stackPtr);
		return a;
	}
}
